package com.luo;

import com.luo.aspect.MyService;
import com.luo.beanfacotryprocesser.Welcomer;
import com.luo.demo.DemoService;
import com.luo.factorybean.MyFactoryBean;
import com.luo.factorybean.MyTestFactoryBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class XmlApplication {
	public static void main(String[] args) {
		ClassPathXmlApplicationContext context =
				new ClassPathXmlApplicationContext("config.xml");
		DemoService demoService = context.getBean(DemoService.class);
		demoService.demo();

		MyService myService = context.getBean(MyService.class);
		myService.testaspect();

		MyFactoryBean myFactoryBean = (MyFactoryBean)context.getBean("&myFactoryBean");
		MyTestFactoryBean myTestFactoryBean = context.getBean(MyTestFactoryBean.class);
		MyTestFactoryBean myTestFactoryBean2 = context.getBean(MyTestFactoryBean.class);

		Welcomer welcomer = (Welcomer) context.getBean("welcomerBean");
		System.out.println("Text: "+welcomer.getWelcomeText());
		context.close();
	}


}
